<html>
<body>
<p>Reports type checks and type casts in a series of if-else statements and replaces them with pattern matching.</p>
<p><b>Example:</b></p>
<pre><code>
  val value = 0
  if (value.isInstanceOf[Int]) {
    val x = value.asInstanceOf[Int] + 1
    val y = value.asInstanceOf[Int] + 2
  } else if (value.isInstanceOf[Long]) {
    val x = value.asInstanceOf[Long]
    println(x)
  }
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
  val value = 0
  value match {
    case i: Int =>
      val x = i + 1
      val y = i + 2
    case x: Long =>
      println(x)
    case _ =>
  }
</code></pre>
<!-- tooltip end -->
</body>
</html>
